import request from '@/utils/request'


export default {
    // /admin/product/getCategory1
    // getCategory1
    // 获取1级分类id
    async getCategory1() {
        // console.log(request.get('/admin/product/getCategory1'));
        const res = await request.get('/admin/product/getCategory1')
        return res
    },
    // GET /admin/product/getCategory2/{category1Id}
    // getCategory2
    getCategory2(category1Id) {
        // 进行判断 如果有值就发送请求 如果没有就是返回一个空串，也不会报错，也不影响展示
        if (category1Id) {
            return request.get(`/admin/product/getCategory2/${category1Id}`)
        } else {
            return ''
        }
    },
    // GET /admin/product/getCategory3/{category2Id}
    getCategory3(category2Id) {
        return request.get(`/admin/product/getCategory3/${category2Id}`)
    },
    // 获取平台属性
    // GET /admin/product/attrInfoList/{category1Id}/{category2Id}/{category3Id}
    // attrInfoList
    attrInfoList({category1Id,category2Id,category3Id}) {
        return request.get(`/admin/product/attrInfoList/${category1Id}/${category2Id}/${category3Id}`)
    }


}